//
// Created by Administrator on 2021/10/13.
//

#ifndef HELLOOPENGL_HELLOASSERT_H
#define HELLOOPENGL_HELLOASSERT_H
#include "HelloException.h"

class HelloAssert{
public:
    static void checkPtr(void * p) {
        check(p != nullptr, "Null Pointer.");
    }
    static void check(bool ex) {
        check(ex, "");
    }
    static void check(bool ex, const char* msg) {
        if(!ex) throw HelloException(msg);
    }
};

#endif //HELLOOPENGL_HELLOASSERT_H
